package com.example.scale;

import org.andengine.engine.camera.Camera;
import org.andengine.entity.sprite.Sprite;
import org.andengine.opengl.util.GLState;

import com.example.scale.SceneManager.SceneType;

public class SplashScene extends BaseScene
{
	private Sprite splash;
	
    @Override
    public void createScene()
    {
    	// Initialize splash sprite, attach it in the middle of the screen, enable dithering
    	splash = new Sprite(0, 0, resourcesManager.splash_region, vbom)
    	{
    	    @Override
    	    protected void preDraw(GLState pGLState, Camera pCamera) 
    	    {
    	       super.preDraw(pGLState, pCamera);
    	       pGLState.enableDither();
    	    }
    	};
    	        
    	//splash.setScale(1.5f);
    	splash.setPosition(GameActivity.CAMERA_WIDTH/2, GameActivity.CAMERA_HEIGHT/2);
    	//splash.setPosition((800-splash.getWidth())/2, (480-splash.getHeight())/2);
    	attachChild(splash);
    }

    @Override
    public void onBackKeyPressed()
    {

    }

    @Override
    public SceneType getSceneType()
    {
    	return SceneType.SCENE_SPLASH;
    }

    @Override
    public void disposeScene()
    {
    	splash.detachSelf();
    	splash.dispose();
    	this.detachSelf();
    	this.dispose();
    }
}

